<?php $this->headTitle($this->title); ?>
<h2><?php echo $this->escape($this->title); ?></h2>
<h4>List of subfolders under directory: <?php echo $this->escape($this->masterPath);?></h4>
<table id="subfolderTable" class="tablesorter">
<thead>
	<tr>
		<th>Subfolder</th>
		<th>Link</th>
		<th>Access</th>
		<th>Action</th>
	</tr>
</thead>
<tbody>
<?php foreach($this->subfolders as $folder) : ?>
	<tr>
		<td><?php echo $this->escape($folder->subfolderName);?></td>
		<td>
		<a href="<?php echo SubfolderAccessManager_Util_Url::_siteURL() . '/' . $this->escape($this->subDir) . $this->escape($folder->subfolderName); ?>" target="_blank">Open in New Tab/Window</a>
		</td>
		<td style="font-weight:bold"><?php echo $folder->hasAccess ? '<font color="green">OK</font>' : '<font color="red">Forbidden</font>';?></td>
		<td>
		<?php if ($folder->hasAccess) { ?>
		<img src="<?php echo $this->baseUrl(); ?>/img/disable.gif"/> <a href="<?php echo $this->url(array('controller'=>'subfolder', 'action'=>'disable', 'name'=>$folder->subfolderName));?>">Disable</a>
		<?php } else { ?>
		<img src="<?php echo $this->baseUrl(); ?>/img/enable.gif"/> <a href="<?php echo $this->url(array('controller'=>'subfolder', 'action'=>'enable', 'name'=>$folder->subfolderName));?>">Enable</a>
		<?php }?>
		</td>
	</tr>
<?php endforeach; ?>
</tbody>
</table>